﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SocialPlatformSDK.Model;
using SocialPlatformSDK.Services.Util;
using SocialPlatformSDK.Util;

namespace SocialPlatformSDK
{
    public class SinaOAuthInfo : OAuthConfigruationBase<SinaOAuthInfo>
    {

        public override void Init()
        {
            base.IfSaveAccessToken = true;
            base.Format = DataFormat.Json;
            base.APP_KEY = "";
            base.APP_SECRET = "";
            base.Authority = "https://api.weibo.com/";
            base.TokenIso = new SafeIsolatedStorage<AccessToken>("Sina_internal_token.dat");

            APIUrl = "https://api.weibo.com/2/";

            CallBackUrl = "";
            //OAuthUri = @"https://open.t.qq.com/cgi-bin/authorize?oauth_token={0}";
           
            GetAccessToken = "/oauth2/access_token";

            //https://api.weibo.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=YOUR_REGISTERED_REDIRECT_URI
            Accredit = string.Format("{0}oauth2/authorize?client_id={1}&response_type=code&redirect_uri={2}&display=mobile", Authority, APP_KEY, CallBackUrl);

            base.AccessToken = new SinaAccessToken();
            base.CodeToken = new SinaCodeToken();
        }
       
    }
}
